<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
 

<t:datagrid name="scoreManageList" title="工种分数比例管理" actionUrl="ScoreManageController.do?scoreWeightDatagrid" 
    fit="true" fitColumns="true" idField="id" queryMode="group" >
	<t:dgCol title="分数ID"  field="id" hidden="true"    queryMode="single"  width="120"></t:dgCol>
	<t:dgCol title="项目负责人"  field="teacher_id" query="false" hidden="true" width="120"></t:dgCol>
	<t:dgCol title="项目负责人"  field="teacher_realName" query="false" hidden="true" width="120"></t:dgCol> 
   <t:dgCol title="课程名称" field="lessonName" hidden="false" query='false' width="120"></t:dgCol>	
   <t:dgCol title="项目1名称" field="scoreItem1Name" query="false" width="100"></t:dgCol>
   <t:dgCol title="项目1比例"  field="scoreItem1Weight"   queryMode="single"  query='false' width="90"></t:dgCol>
   <t:dgCol title="项目2名称" field="scoreItem2Name" query="false" width="100"></t:dgCol>
   <t:dgCol title="项目2比例"  field="scoreItem2Weight"   queryMode="single"  query='false' width="90"></t:dgCol>
   <t:dgCol title="项目3名称" field="scoreItem3Name" query="false" width="100"></t:dgCol>
   <t:dgCol title="项目3比例"  field="scoreItem3Weight"   queryMode="single"  query='false' width="90"></t:dgCol>
   <t:dgCol title="项目4名称" field="scoreItem4Name" query="false" width="100"></t:dgCol>
   <t:dgCol title="项目4比例"  field="scoreItem4Weight"   queryMode="single"  query='false' width="90"></t:dgCol>
   <t:dgCol title="项目5名称" field="scoreItem5Name" query="false" width="100"></t:dgCol>
   <t:dgCol title="项目5比例"  field="scoreItem5Weight"   queryMode="single"  query='false' width="90"></t:dgCol>
   <t:dgCol title="common.operation" field="opt"  width="120"></t:dgCol>
   <t:dgFunOpt  funname="setScore(id,teacher_id,teacher_realName)" title="编辑分数"  />
 </t:datagrid>

<script type="text/javascript">

    
//导出
function ExportXls() {
	var currentId = "${current.id}";

	var semester = currentId;
	
	JeecgExcelExport("ScoreManageController.do?exportXls&semester="+semester,"scoreManageList");
}

function downLoadTemplate(){
	window.location.href="studentController.do?exportTemplate";
}
 
 
    
 function setScore(id,teacherId,teacherName){
	 //校验是否当前工种负责人
	 var currentUserId = "${currentUser.id}";
	 if(teacherId == ''){
		 tip("当前工种项目负责人未设置，请设置后由项目负责人进行分数设置");
		 return ;
	 }
	 
     if(currentUserId != teacherId ){
    	 tip("当前用户非项目负责人，无权进行操作，负责人为："+teacherName);
    	return;	 
     }	 
    	
    	var url="ScoreManageController.do?goSetScoreWeight&id="+id;
    	
    	$.dialog({
		  	id:'xxx',
			content: 'url:'+url,
			lock : true,
			zIndex: getzIndex(), 
			width:480,
			height:450,
			title:'设置分数比例', 
			opacity : 0.3,
			cache:false,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
		    	saveObj();
		    	return false;
		    },
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
	});
  }


 
</script>
